package ysu.sxm.ptjc.Controller;

import com.alibaba.fastjson.JSONArray;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ysu.sxm.ptjc.Domin.InvalidationReq;

import ysu.sxm.ptjc.Service.InvalidationService;

import javax.annotation.Resource;
import java.text.ParseException;

@RestController
@RequestMapping("/Invalidation")
public class InvalidationServlet {
    @Resource
    InvalidationService invalidationService;
    @PostMapping("/getDate")
    String lists(@RequestBody InvalidationReq invalidationReq) throws ParseException {
        return JSONArray.toJSONString(invalidationService.dealWithInvReq(invalidationReq));

    }
}
